package ls.ch03.demo.demo9;

import net.sf.cglib.proxy.Enhancer;

/**
 * @author ls
 * @Date 创建时间:2022/4/9 14:24
 * 描述:
 */

public class IntermediaryCglibProxyFactory {
    private static IntermediaryMethodInterceptor callback=new IntermediaryMethodInterceptor();
    public static <T> T create(Class<T>target){
        Enhancer enhancer=new Enhancer();
        enhancer.setCallback(callback);
        enhancer.setSuperclass(target);
        return (T) enhancer.create();
    }
}
